package com.atguigu.yygh.cmn;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: yygh_parent
 * @author: Mr.Zhuo
 * @create: 2022-03-10 08:57
 **/

public class EasyExcelTest01 {

    public static void main(String[] args) {
        // 首先读取excel文档位置
        String fileName="D:\\112.xlsx";

        EasyExcel.read(fileName,Stu.class,new EasyExcelListener()).sheet().doRead();



    }

    //循环设置要添加的数据，最终封装到list集合中
    private static List<Stu> data() {
        List<Stu> list = new ArrayList<Stu>();
        for (int i = 0; i < 10; i++) {
            Stu data = new Stu();
            data.setSno(i);
            data.setSname("张三"+i);
            list.add(data);
        }
        return list;
    }


}
